<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    // console.log(window)
    // let enumTheUndefinedFlag = false
    // for(let key in window){
    //     if(key===undefined){
    //         enumTheUndefinedFlag = true
    //     }
    // }
    // console.log(enumTheUndefinedFlag)
    /*
        window.undefined 不可写（writable=false）
     */
    // window.undefined = 1
    // console.log(window.undefined)

    // delete window.undefined
    // console.log(window)
    // console.log(window.undefined)

    /*
       ❌ERROR: Uncaught TypeError: Cannot convert undefined or null to object at Function.defineProperties
    */
    // Object.defineProperties(window,undefined,{
    //     writable:true,
    //     enumerable:true,
    //     configurable:true
    // })
    // var undefined = 1
    // console.log(undefined) //undefined


    // console.log(void(0)===undefined) //true


    function scoped(){
        let a
        const b = 1
        const undefined = 2
        if(a===void(0)){
            console.log("a 尚未定义值！")
        }else{
            console.log("a 定义值了！")
        }
    }
    scoped()



</script>
</html>